home *** CD-ROM | disk | FTP | other *** search
/ Amoszine 10 / Amoszine 10 (Disk 3 of 3).adf / Text_Files.lha / pp_lib_amos.txt next >
Text File  |  1995-12-11  |  3KB  |  67 lines

  1.  AJ>  I was wondering if you could tell me the information regarding using
  2.  AJ>  Powerpacker.library for crunching files from AMOS.  Simple details
  3.  AJ>  regarding the relevant routine offset and what to load the various
  4.  AJ>  registers with and the info returned by the routine would be much
  5.  AJ>  appreciated.
  6.  
  7. Quick cut'n'paste job from the autodoc:
  8.  
  9. crunchinfo = ppAllocCrunchInfo (efficiency, speedup, function, userdata);
  10. APTR ppAllocCrunchInfo (ULONG, ULONG, BOOL (*)(), APTR);
  11. D0                      D0     D1     A0          A1
  12. _LVOppAllocCrunchInfo = -96
  13.  
  14. Forget the 'function' and 'userdata', they are more trouble than they
  15. are worth with AMOS, just pass a NULL in A0 and A1.
  16. More? (Y,n,c): 
  17.  
  18. ppFreeCrunchInfo (crunchinfo);
  19. void ppFreeCrunchInfo (APTR);
  20.                        A0
  21. _LVOppFreeCrunchInfo = -102
  22.  
  23.  
  24. crunchedlen = ppCrunchBuffer (crunchinfo, buffer, len);
  25. ULONG ppCrunchBuffer (APTR, UBYTE *, ULONG);
  26. D0                    A0    A1       D0
  27. _LVOppCrunchBuffer = -108
  28.  
  29.  
  30. ppDecrunchBuffer (endcrun, decrbuff, effptr, col);
  31. void ppDecrunchBuffer (UBYTE *, UBYTE *, ULONG *, ULONG);
  32.                        A0       A1       A2       D0
  33. _LVOppDecrunchBuffer = -36
  34.  
  35.  
  36. success = ppWriteDataHeader (lock, efficiency, crypt, checksum);
  37. ULONG ppWriteDataHeader (BPTR, ULONG, BOOL, ULONG);
  38. D0                       D0    D1     D2    D3:16
  39. _LVOppWriteDataHeader = -114
  40.  
  41. You need to use this to write the 'PP20...' bit at the start of the
  42. crunched file, the problem is you will need to create the file using
  43. dos.library's Open() function and write the buffer with Write().
  44.  
  45.  
  46. Since I'm in a generous mood, here's a short proggy to show the
  47. crunching and decrunching, it uses the screen bitmap so you can
  48. actually see it working. It's saved as ASCII, LhA'd and uuencoded cos
  49. it's a bit too big to list here.
  50.  
  51. See ya,
  52. Paul.
  53.  
  54. begin 644 ppCrunch.lha
  55. M(I`M;&@U+2L$```J"0```63!'@``#'!P0W)U;F-H+F%S8RRG`ZIKN]&FW(/.Y
  56. M_@#_A9+2;,$P++KM$_`#?.86(V)@66V(47#.<C48^>[N+*;XX_\^;82"F66\!
  57. M6JO@N<.TK;:;YI2[IU!F+.92C`XW^,$$#6>1!C4!%2/PXWAP.-X.CVMX&\I_%
  58. M)!DM03E3X!%+*'[@]N0FKDU^349MH7;H$^A=M,Y@U[I93(#<DR0*"9J.]?DF#
  59. M53.6@P3G\@%F`FIUBNX],#N4_?K*DW,YSM9\GR=P.?F+XX-GL1,,2)/M,&PJX
  60. MB@HX*\+70*/B=%BM0'0'P=<#0<,'1T-``+\.1V_5X7%^`?V8_B8,3?PK[9*)C
  61. M`Q+YPF^B@:9\VOEX]"5%H4E?CS9N[+DQNWU\/>2-W#T#0A:0'7-1-MW;0^9D!
  62. M)F/0,P?UNF0;8N*1H.$B-U$G@-"0E'@H4(6AU3GUEG!C5L>09Z3&V;J;)<3-`
  63. M_8TL:SYB$?TBDXH^HCKEO?K(_DT]8PE9X,_7BRY7<%K.)++-),:@?\6,2"#N:
  64. M@Q9]`L%?):[$]&05]?;JBB?%:7R&7OC5VPU=L9!4_9:U'S,E`)#SG6`AI][N*
  65. M>BRN"UV<;XM(>.:+)#H&E.!?3.]'$,-X5\X8H2<6A32]4T,;)T,A!T)769Z/Z
  66. M3"]_&+'%'H(^+='Q#>F`D<0Q#!EB
  67.